<!DOCTYPE html>
<html lang="zh-Hans-CN">
<head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="../vue.js"></script>
</head>
<body>
<h2>【例34】Vue生命周期:数据更新</h2>
<hr>
<div id="app">
    <div v-if="isShow" ref="aaa">测试div：变化：存在或不存在</div>
    <button @click="isShow = !isShow">更新</button>
</div>
<script>
    let vm = new Vue({
        el: '#app',
        data: {isShow: false},
        beforeUpdate() {
            console.log('更新之前');
            console.log(this.$refs.aaa)
        },
        updated() {
            console.log('更新之后');
            console.log(this.$refs.aaa)
        }
    })
</script>
<hr>
<p><a href="index.html">返回章节目录</a>
    <script>document.write(document.lastModified); </script>
</p>
</body>
</html>
